package com.shujia.flink.source;

import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * @author SHUJIA
 */
public class Demo3SocketSource {
    public static void main(String[] args) throws Exception{
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        /*
         * 基于socket构建source  -- 无界流
         */
        DataStreamSource<String> lines = env.socketTextStream("master", 8888);

        lines.print();

        env.execute();
    }
}
